#!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@author: henry_oulen@163.com
@file: dev.config.py
@time: 2023/10/28 10:32
@desc: 
"""
import os

from backend.tvadmin.utils.g_id import IdWorkerObject

# Redis配置
redis_options = {
    'redis_host': '127.0.0.1',
    'redis_port': 6379,
    'redis_password': '',
    'redis_username': '',
    'redis_db': 0,
}

mysql = {
    "host": "127.0.0.1",
    "user": "root",
    "password": "ygwork2021%!.",
    "database": "tornado_vue_admin",
    "port": "3306"
}

sqlalchemy_echo_log = False

create_tables = True

# Tornado app配置
settings = {
    'template_path': os.path.join(os.path.dirname(__file__), 'templates'),
    # 'static_path': os.path.join(os.path.dirname(__file__), 'statics'),
    'static_path': os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'statics'),
    'media_path': os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'media'),
    'cookie_secret': '0Q1AKOKTQHqaa+N80XhYW7KCGskOUE2snCW06UIxXgI=',
    'xsrf_cookies': False,
    'login_url': '/login',
    'debug': False,
    "secret_key": "Bearer_",
    "jwt_expire": 7 * 24 * 3600,
    "host": "127.0.0.1",
    "port": 8000,
}

table_prefix = "tvadmin_"

secret_prefix = "Bearer_"

# 日志
# log_path = os.path.join(os.path.dirname(__file__), 'logs/')
log_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'logs/')
snowflake = IdWorkerObject()

captcha_len = 6

# 日志配置
log_level = "INFO"  # help="Set the log level (DEBUG, INFO, WARNING, ERROR)")
log_file_prefix = "server.log"  # help="Path to the log file")
log_rotate_when = "midnight"  # help="When to rotate the log file (midnight, S, M, H, D, W0-6)")
log_rotate_backup_count = 7  # help="Number of backup copies to keep")

open_captcha = True  # 是否开启防爆次数

algorithm = ["HS256"]

redis_auth_key = "jwttokens"

backend_url = "https://www.baidu.com"